<?php
/**
 * gpa_new Description
 * @package
 * @name Session
 * @filesource Session.php
 * @author Meta Sanjaya
 */

class Session
{
    private $_session;

    /**
     * @access public
     * @method __construct
     * @param void
     * @return void
     */
    public function  __construct()
    {
        if(!session_id()) {
            @session_start();
        }
        $this->_session =& $_SESSION;
    }

    public function set($name, $value)
    {
        $this->remove($name);
        $this->_session[$name] = $value;
    }

    public function remove($name)
    {
        if(isset($this->_session[$name])) {
            unset($this->_session[$name]);
        }
    }

    public function destroy()
    {
        @session_destroy();
    }

    public function get($name)
    {
        return(isset($this->_session[$name])?$this->_session[$name]:false);
    }
}

?>